package eu.robico.simulator.simulatorinterface.actionpanel.objects;

import java.awt.Color;
import java.awt.Graphics2D;

import eu.robico.simulator.simulatorinterface.actionpanel.Position;

class ObstacleObject implements ActionPanelObject 
{
	private Position position;
	private int width = 16;
	
	public ObstacleObject(Position position)
	{
		this.position = position;
	}
	
	public void setWidth(int width)
	{
		this.width = width;
	}
	
	public Position getPosition()
	{
		return position;
	}
	
	public int getWidth()
	{
		return width;
	}
	
	@Override
	public void paint(Graphics2D graphics) 
	{
		int correction = width / 2;
		graphics.setColor(Color.RED);
		graphics.fillRect(position.xAsInt() - correction, position.yAsInt() - correction, width, width);
	}
	

}
